<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Language" content="en-us" />
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta name="Description" content="A map of restaurants in the Los Angeles area. Think Green With Your Cuisine allows you to search for restaurants by proximity to you, price range, and style. It's good stuff." />
	<meta name="Keywords" content="google all nighter, restaurants, los angeles, ca, california, think green, cuisine, breakfast, lunch, dinner, usc, api" />
	<title>Think Green with Your Cuisine</title>
	<link rel="stylesheet" href="style.css" type="text/css" />
	<link rel="shortcut icon" href="images/favicon.ico" />
	<script type="text/javascript" src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAD0mIOcTSublZHWPxM4g0sRRcg083Mpxx5Mkzaj-iB9BI5TfCuhTgJyZxDMYjsmDw8vjGRrRnxyXVsw"></script>
	<script type="text/javascript" src="javascripts/getelem.js"></script>
	<script type="text/javascript" src="javascripts/map.js"></script>
	<script type="text/javascript" src="javascripts/tabs.js"></script>
	<script type="text/javascript" src="javascripts/restaurants.js"></script>
	<script type="text/javascript" src="javascripts/settings.js"></script>
	<script type="text/javascript" src="javascripts/tooltip.js"></script>
</head>
<body onload="initialize()" onunload="GUnload()">

<div id="page">
<div id="page_header">
	<a href="http://greencuisine.javconcepts.com/"><img src="images/logo.png" alt="Think Green with Your Cuisine" title="Think Green with Your Cuisine" /></a>
</div>

<div id="page_tabs">
	<ul>
		<li><a id="tab_link_main" onclick="switchTab('main')" class="active">Main</a></li>
		<li><a id="tab_link_settings" onclick="switchTab('settings')">Settings</a></li>
		<li><a id="tab_link_about" onclick="switchTab('about')">About</a></li>
	</ul>
</div>

<div id="page_content">
	<div id="tab_main">
		<div id="restaurants">
			<div id="restaurants_control">
				<h3>Restaurants</h3>
				<select id="green" onchange="getRestaurants('restaurants_data', 'green', 'cuisine', 'settings_limit')">
					<option value="">Think Green</option>
					<option value="$">$</option>
					<option value="$$">$$</option>
					<option value="$$$">$$$</option>
					<option value="$$$$">$$$$</option>
				</select>
				<select id="cuisine" onchange="getRestaurants('restaurants_data', 'green', 'cuisine', 'settings_limit')">
					<option value="">Your Cuisine</option>
<?php
$con = mysql_connect("localhost","greencuisine",'greencui$ine');
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("greencuisine", $con);

$result = mysql_query("SELECT DISTINCT `cuisine` FROM `restaurants` WHERE `geocoded` = '1'");

while($row = mysql_fetch_assoc($result)) {
	echo "\t\t\t\t\t<option value=\"{$row['cuisine']}\">{$row['cuisine']}</option>\n";
}
?>
				</select>
			</div>
			<div id="restaurants_data">
			</div>
		</div>
		<div id="map_canvas"></div>
	</div>

	<div id="tab_settings">
		<h3>Settings</h3>
		<table>
			<tr onmouseover="toolTip('Home Address: The address you will be coming from.')" onmouseout="toolTipExit()">
				<td>Home Address:</td><td>
				<input type="text" id="settings_home" value="" /> <input type="button" value="Set" onclick="changeHome('settings_home', 'settings_home_result')" /></td></tr>
			<tr onmouseover="toolTip('Miles per Gallon: The average miles per gallon for your vehicle.')" onmouseout="toolTipExit()">
				<td>Miles per Gallon:</td><td>
				<input type="text" id="settings_mpg" value="25.00" /></td></tr>
			<tr onmouseover="toolTip('Dollars per Gallon: The price per gallon of gasoline.')" onmouseout="toolTipExit()">
				<td>Dollars per Gallon:</td><td>
				<input type="text" id="settings_dpg" value="3.00" /></td></tr>
			<tr onmouseover="toolTip('Pounds of CO<sub>2</sub> per Gallon: The constant expressing the mass of CO<sub>2</sub> produces per each gallon of gasoline burned.')" onmouseout="toolTipExit()">
				<td>Pounds of CO<sub>2</sub> per Gallon:</td>
				<td>
				<input type="text" id="settings_cpg" value="19.4" /></td></tr>
			<tr onmouseover="toolTip('Restaurants to Display: The number of restaurants to display on the sidebar.')" onmouseout="toolTipExit()">
				<td>Restaurants to Display:</td><td>
				<input type="text" id="settings_limit" value="10" /></td></tr>
			<tr onmouseover="toolTip('Open Restaurant Website: Where restaurant links open up.')" onmouseout="toolTipExit()">
				<td>Open Restaurant Website:</td><td>
				<select id="settings_target">
					<option value="_blank" selected>in new window</option>
					<option value="self">in this window</option>
				</select>
			</td></tr>
			<tr onmouseover="toolTip('Map Height: Adjust the map height on the main tab.')" onmouseout="toolTipExit()">
			<td>Map Height:</td><td>
				<select id="settings_mapheight" onchange="changeHeight('map_canvas', 'settings_mapheight')">
					<option value="400">400</option>
					<option value="500">500</option>
					<option value="600" selected>600</option>
					<option value="700">700</option>
					<option value="800">800</option>
				</select>
			</td></tr>
		</table>
	</div>

	<div id="tab_about">
		<h3>Summary</h3>
		<p>Think Green with Your Cuisine is a <a href="http://code.google.com/apis/maps/">Google Maps API</a> and <a href="http://losangeles.citysearch.com/">CitySearch Los Angeles</a> mashup that provides the user with the best possible information about restaurants.  The page will list extensive information about each restaurant including it's name, url, address, phone number, type of cuisine, and average cost per person.  In addition to the basic information about each restaurant, if users enter in their home address, extra information such as travel distance, travel cost (for gasoline), and estimated CO2 waste is given.  All of this information is provided so that the user can make an informed decision about when they choose to eat.  Read more at the <a href="http://code.google.com/p/greencuisine/w/list">wiki</a>.</p>
		
		<h3>Background</h3>
		<p>Think Green With Your Cuisine was created for the Google All-Nighter Coding Competition at the University of Southern California in February 2008.  Teams had 24 hours to create an entire webpage from scratch, while implementing a Google API in the processs.  The contest took place between 12pm February 17, 2008 and 12pm February 18, 2008.</p>
		
		<h3>Techonology</h3>
		<p>This website is hosted on a <a href="http://fedoraproject.org/">Fedora</a> box with <a href="http://www.javconcepts.com/">javconcepts.com</a>.  Other technologies that this website uses includes <a href="http://www.php.net/">PHP</a>, <a href="http://www.mysql.com/">MySQL</a>, and <a href="http://www.apache.org/">Apache</a>.  The project was managed with <a href="http://subversion.tigris.org/">Subversion</a> on Google's <a href="http://code.google.com/hosting/">Project Hosting</a> and tested in Mozilla's <a href="http://www.mozilla.com/en-US/firefox/">Firefox</a>.</p>
		
		<h3>Achievements (in 24 hours)</h3>
		<p>&gt; 10,000 restaurants indexed.</p>
		<p>&gt; 3,500 lines of code written.</p>
		<p>9 images created.</p>
		<p>&gt; 100 svn commits.</p>
		<p>most useful website of the contest!</p>
		
		<h3>Blue Barracudas</h3>
		<p>TJ Breisacher - USC undergrad 2010, majoring in Physics and Computer Science, Master of Google Maps API</p>
		<p>David Valdez - USC undergrad 2011, majoring in Computer Science and Business Administration, Master of GIMP and graphical design.</p>
		<p>Ben Walker - USC undergrad 2011, majoring in Computer Science - Games, Master of site scraping pizzazz and database intricacies.</p>
		<p>Josh Villbrandt - USC undergrad 2011, majoring in Astronautical Engineering, minoring in Computer Science, Master of web layout, css, and javascript.</p>
	</div>

</div>

<div id="page_footer">
&copy; 2008 Blue Barracudas. &nbsp; Hosted at <a href="http://www.javconcepts.com/"><span style="color: #ff9900;">jav</span>concepts.com</a>. &nbsp; Released under <a href="http://www.gnu.org/licenses/gpl.html">GPLv3</a>.
</div>
</div>

<script type="text/javascript">
getRestaurants('restaurants_data', 'green', 'cuisine', 'settings_limit');
</script>

</body>
</html>
